{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "h8WhGb1a_6Wl" }, "source": [ "# Parcial Corte 2 AAD\n", "###### Camila Rayen Nahuel, Mariana Ramírez, Santiago Hoyos\n" ] }, { "cell_type": "markdown", "metadata": { "id": "iKFQIOOH973H" }, "source": [ "### Análisis Exploratorio de Datos y pre-procesamiento" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "-_4LCIzR_Dj-" }, "outputs": [], "source": [ "import warnings\n", "warnings.filterwarnings('ignore')\n", "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import pandas as pd\n", "import math\n", "\n", "from sklearn.linear_model import LinearRegression\n", "from sklearn.metrics import r2_score\n", "from sklearn.model_selection import train_test_split\n", "from scipy import stats\n", "from patsy import dmatrix\n", "from sklearn.metrics import mean_squared_error\n", "from sklearn.preprocessing import StandardScaler, MinMaxScaler" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 255 }, "id": "yAKLIp2MI3b7", "outputId": "daf5a187-817e-4735-ad25-42eccf3630f4" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " MSSubClass MSZoning LotArea Street LotShape LandContour Utilities \\\n", "0 60 RL 8450 Pave Reg Lvl AllPub \n", "1 20 RL 9600 Pave Reg Lvl AllPub \n", "2 60 RL 11250 Pave IR1 Lvl AllPub \n", "3 70 RL 9550 Pave IR1 Lvl AllPub \n", "4 60 RL 14260 Pave IR1 Lvl AllPub \n", "\n", " LotConfig LandSlope Neighborhood ... EnclosedPorch 3SsnPorch ScreenPorch \\\n", "0 Inside Gtl CollgCr ... 0 0 0 \n", "1 FR2 Gtl Veenker ... 0 0 0 \n", "2 Inside Gtl CollgCr ... 0 0 0 \n", "3 Corner Gtl Crawfor ... 272 0 0 \n", "4 FR2 Gtl NoRidge ... 0 0 0 \n", "\n", " PoolArea MiscVal MoSold YrSold SaleType SaleCondition SalePrice \n", "0 0 0 2 2008 WD Normal 208500 \n", "1 0 0 5 2007 WD Normal 181500 \n", "2 0 0 9 2008 WD Normal 223500 \n", "3 0 0 2 2006 WD Abnorml 140000 \n", "4 0 0 12 2008 WD Normal 250000 \n", "\n", "[5 rows x 60 columns]" ], "text/html": [ "\n", "
| \n", " | MSSubClass | \n", "MSZoning | \n", "LotArea | \n", "Street | \n", "LotShape | \n", "LandContour | \n", "Utilities | \n", "LotConfig | \n", "LandSlope | \n", "Neighborhood | \n", "... | \n", "EnclosedPorch | \n", "3SsnPorch | \n", "ScreenPorch | \n", "PoolArea | \n", "MiscVal | \n", "MoSold | \n", "YrSold | \n", "SaleType | \n", "SaleCondition | \n", "SalePrice | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "60 | \n", "RL | \n", "8450 | \n", "Pave | \n", "Reg | \n", "Lvl | \n", "AllPub | \n", "Inside | \n", "Gtl | \n", "CollgCr | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2 | \n", "2008 | \n", "WD | \n", "Normal | \n", "208500 | \n", "
| 1 | \n", "20 | \n", "RL | \n", "9600 | \n", "Pave | \n", "Reg | \n", "Lvl | \n", "AllPub | \n", "FR2 | \n", "Gtl | \n", "Veenker | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "5 | \n", "2007 | \n", "WD | \n", "Normal | \n", "181500 | \n", "
| 2 | \n", "60 | \n", "RL | \n", "11250 | \n", "Pave | \n", "IR1 | \n", "Lvl | \n", "AllPub | \n", "Inside | \n", "Gtl | \n", "CollgCr | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "9 | \n", "2008 | \n", "WD | \n", "Normal | \n", "223500 | \n", "
| 3 | \n", "70 | \n", "RL | \n", "9550 | \n", "Pave | \n", "IR1 | \n", "Lvl | \n", "AllPub | \n", "Corner | \n", "Gtl | \n", "Crawfor | \n", "... | \n", "272 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2 | \n", "2006 | \n", "WD | \n", "Abnorml | \n", "140000 | \n", "
| 4 | \n", "60 | \n", "RL | \n", "14260 | \n", "Pave | \n", "IR1 | \n", "Lvl | \n", "AllPub | \n", "FR2 | \n", "Gtl | \n", "NoRidge | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "12 | \n", "2008 | \n", "WD | \n", "Normal | \n", "250000 | \n", "
5 rows × 60 columns
\n", "